home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group02b.txt / 000048_icon-group-sender_Thu Oct 3 13:17:38 2002.msg < prev    next >
Internet Message Format  |  2003-01-02  |  16KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id g93KHNs18043
  4.     for icon-group-addresses; Thu, 3 Oct 2002 13:17:23 -0700 (MST)
  5. Message-Id: <200210032017.g93KHNs18043@baskerville.CS.Arizona.EDU>
  6. From: icon-project@cs.arizona.edu
  7. X-Newsgroups: comp.lang.icon,comp.answers,news.answers
  8. Subject: Icon Programming Language FAQ
  9. Date: 3 Oct 2002 10:03:54 -0700
  10. To: icon-group@cs.arizona.edu
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13.  
  14. Archive-name: comp-lang-icon-faq
  15. Posting-Frequency: monthly
  16.  
  17.  
  18.         Frequently Asked Questions about the Icon programming language
  19.  
  20.    www.cs.arizona.edu/icon/faq.htm
  21.    Last updated October 1, 2002
  22.  
  23.    Learning about Icon
  24.    A1. What is Icon?
  25.    A2. What is Icon good for?
  26.    A3. What are Icon's distinguishing characteristics?
  27.    A4. What is the Icon program library?
  28.    A5. Where can I learn more about Icon?
  29.    A6. How about comprehensive documentation?
  30.  
  31.    Implementations
  32.    B1. What platforms support Icon?
  33.    B2. How do I get started with Icon?
  34.    B3. Is there a Unicode version of Icon?
  35.    B4. What happened to the compiler?
  36.  
  37.    Administration
  38.    C1. What is the Icon Project?
  39.    C2. How often is the on-line material updated?
  40.    C3. Where did Icon come from?
  41.    C4. Where is Icon going? 
  42.  
  43.    Support
  44.    D1. Is there a users' group for Icon?
  45.    D2. How do I get technical support?
  46.  
  47.    Programming
  48.    E1. Why doesn't read() work with every?
  49.    E2. Why doesn't string invocation such as "foo"() work?
  50.    E3. How can I call a C function?
  51.    E4. Can I open a bidirectional pipe?
  52.      _________________________________________________________________
  53.  
  54. Learning about Icon
  55.  
  56.   A1. What is Icon?
  57.  
  58.    Icon is a very high level general-purpose programming language with
  59.    extensive features for processing strings (text) and data structures.
  60.    Icon is an imperative, procedural language with a syntax that is
  61.    reminiscent of C and Pascal, but with semantics at a much higher
  62.    level.
  63.  
  64.    Icon has a novel expression-evaluation mechanism that integrates
  65.    goal-directed evaluation and backtracking with conventional control
  66.    structures. It has a string scanning facility for pattern matching
  67.    that avoids the tedious details usually associated with analyzing
  68.    strings. Icon's built-in data structures include sets and tables with
  69.    associative lookup, lists that can be used as vectors or stacks and
  70.    queues, and records.
  71.  
  72.    Icon is a strongly, though not statically, typed language. It provides
  73.    transparent automatic type conversion: For example, if an integer is
  74.    used in an operation that requires a string, the integer is
  75.    automatically converted to a string.
  76.  
  77.    Several implementations of Icon have high-level graphics facilities
  78.    with an easily programmed window interface.
  79.  
  80.    Icon manages storage automatically. Objects are created as needed
  81.    during program execution and space is reclaimed by garbage collection
  82.    as needed. The sizes of strings and data structures are limited only
  83.    by the amount of available memory.
  84.  
  85.   A2. What is Icon good for?
  86.  
  87.    As a general-purpose programming language with a large computational
  88.    repertoire, Icon can be used for most programming tasks. It's
  89.    especially strong at building software tools, for processing text, and
  90.    for experimental and research applications.
  91.  
  92.    Icon is designed to make programming easy; it emphasizes the value of
  93.    programmer's time and the importance of getting programs to work
  94.    quickly. Consequently, Icon is used both for short, one-shot tasks and
  95.    for very complex applications.
  96.  
  97.   A3. What are Icon's distinguishing characteristics?
  98.  
  99.      * A high-level, general-purpose programming language
  100.      * Friendly line-oriented syntax (no semicolons needed)
  101.      * Emphasis on programmer productivity
  102.      * Usually interpreted
  103.  
  104.      * Evolved from programming languages (vs. scripting languages)
  105.      * Procedural control flow plus generators and goal-directed
  106.        evaluation
  107.  
  108.      * Values have types; variables are typeless, accept any value
  109.      * Static scoping: global or (procedure) local
  110.      * Automatic garbage collection
  111.  
  112.      * All integers have arbitrary precision
  113.      * Uses strings (not chars) as basic text datatype
  114.      * Has lists that function as arrays, queues, and stacks
  115.      * Also has sets, tables, records (structs), reals (doubles), more
  116.      * No second-class "primitive types"
  117.  
  118.      * Not "object-oriented" (no classes, inheritance, or instance
  119.        methods)
  120.      * No exception catching
  121.      * No concurrency (no threads, monitors, semaphores, or
  122.        synchronization)
  123.      * Has co-expressions (coroutines)
  124.  
  125.      * Basic least-common-denominator system interface (a la ANSI C)
  126.  
  127.      * Procedural graphics (event-driven paradigm available but not
  128.        mandated)
  129.      * Retained windows (programs are never called to repaint)
  130.      * Simple GUI builder that can re-edit its generated code
  131.      * Turtle graphics package
  132.  
  133.      * Large library of contributed procedures and programs
  134.  
  135.   A4. What is the Icon program library?
  136.  
  137.    The library is a collection of programs and procedures written in
  138.    Icon. User contributions are welcome and form a significant portion of
  139.    the library.
  140.  
  141.    Library procedures effectively augment the built-in functions
  142.    available to an Icon program. A wide variety of procedures currently
  143.    exists, and most graphically-based programs are built around library
  144.    procedures.
  145.  
  146.    The programs in the library range from simple demonstrations to handy
  147.    tools to complex graphical applications.
  148.  
  149.    The library is a resource for both new and experienced programmers. In
  150.    addition to their basic utility, its programs and procedures serve as
  151.    examples of how things can be written in Icon.
  152.  
  153.   A5. Where can I learn more about Icon?
  154.  
  155.    Here are some good places to start.
  156.      * Ralph Griswold's overview: www.cs.arizona.edu/icon/docs/ipd266.htm
  157.      * Dave Hanson's introduction: www.cs.arizona.edu/icon/intro.htm
  158.      * John Shipman's tutorial: www.nmt.edu/tcc/help/lang/icon
  159.  
  160.   A6. How about comprehensive documentation?
  161.  
  162.    Two books specify the Icon language. The core language is covered by
  163.    The Icon Programming Language (third edition), by Griswold and
  164.    Griswold. Graphics facilities are described in Graphics Programming in
  165.    Icon by Griswold, Jeffery, and Townsend. These books contain both
  166.    tutorial and reference material. They are available from RTC Books
  167.    (www.rtcbooks.com, search for "Icon") or from Jeffery Systems
  168.    (www.zianet.com/jeffery/books). Additionally, The Icon Programming
  169.    Language can be downloaded at no charge from the Icon books page,
  170.    www.cs.arizona.edu/icon/books.htm.
  171.  
  172.    Icon's internals are detailed in The Implementation of the Icon
  173.    Programming Language by Griswold and Griswold (Princeton, 1986, out of
  174.    print). Although considerable changes have occurred since Version 6,
  175.    described in the book, the basic structure is the same. Two technical
  176.    reports, IPD112 and IPD239, describe subsequent changes.
  177.  
  178.    The Icon Programming Language Handbook, by Thomas W. Christopher, is
  179.    available on the web at www.toolsofcomputing.com/IconHandbook.
  180.  
  181.    There is a large amount of additional information at the Icon web
  182.    site, www.cs.arizona.edu/icon.
  183.      _________________________________________________________________
  184.  
  185. Implementations
  186.  
  187.   B1. What platforms support Icon?
  188.  
  189.    Current implementations with graphics support are available for Unix
  190.    and Windows. On the Macintosh, the Unix implementation runs under
  191.    MacOS X, with graphics using XFree86. Older versions of Icon are
  192.    available for some other systems. An alternative Java-based
  193.    implementation for Unix, Jcon, is also available.
  194.  
  195.   B2. How do I get started with Icon?
  196.  
  197.    Version 9.4.1 of Icon for Unix can be downloaded from
  198.    www.cs.arizona.edu/icon/v941. Source and binary packages are
  199.    available, each with the complete Icon program library.
  200.  
  201.    Version 9.3 of Icon for Windows is compatible at the source level with
  202.    version 9.4.1. It can be downloaded from
  203.    www.cs.arizona.edu/icon/v93w.htm. The Version 9.4.1 library can be
  204.    obtained separately from www.cs.arizona.edu/icon/v941.
  205.  
  206.    For older implementations, start at
  207.    www.cs.arizona.edu/icon/implver.htm. Jcon is at
  208.    www.cs.arizona.edu/icon/jcon.
  209.  
  210.   B3. Is there a Unicode version of Icon?
  211.  
  212.    No. Icon is defined in terms of 8-bit characters, and changing this
  213.    presents several design challenges that would likely break existing
  214.    programs. Also, modifying the C implementation is probably infeasible,
  215.    but a Unicode version of Jcon might be possible.
  216.  
  217.   B4. What happened to the compiler?
  218.  
  219.    For a while, Unix distributions included both an interpreter and a
  220.    compiler; but the interpreter is is usually fast enough even for
  221.    production work, and most people found that using the compiler wasn't
  222.    worth the extra compilation time or the hassles involved. We no longer
  223.    advertise the compiler or produce binaries for it. It is still part of
  224.    the source code distribution, and we have not deliberately broken it,
  225.    but we no longer support it and we cannot offer help if problems
  226.    arise.
  227.      _________________________________________________________________
  228.  
  229. Administration
  230.  
  231.   C1. What is the Icon Project?
  232.  
  233.    The Icon Project is a name used by the group that distributes and
  234.    supports the Icon programming language. The project maintains the Icon
  235.    web site at www.cs.arizona.edu/icon. A non-commercial organization,
  236.    the project is supported by the Department of Computer Science at the
  237.    University of Arizona.
  238.  
  239.   C2. How often is the on-line material updated?
  240.  
  241.    New material is added when it's available. Established implementations
  242.    usually are updated only when there's a new version. This typically is
  243.    every year or two. The Icon program library is updated on a similar
  244.    schedule.
  245.  
  246.   C3. Where did Icon come from?
  247.  
  248.    Icon is the latest in a series of high-level programming languages
  249.    designed to facilitate programming tasks involving strings and
  250.    structures. The original language, SNOBOL, was developed at Bell
  251.    Telephone Laboratories in the early 1960s. SNOBOL evolved into
  252.    SNOBOL4, which is still in use. Subsequent languages were developed at
  253.    the University of Arizona with support from the National Science
  254.    Foundation. Although it has similar objectives and many similar
  255.    capabilities, Icon bears little superficial resemblance to SNOBOL4.
  256.  
  257.    Icon implementations were developed by faculty, staff, and students at
  258.    the University of Arizona, with significant contributions from
  259.    volunteers around the world. An Icon history by Ralph and Madge
  260.    Griswold appears in the preprints of the second History of Programming
  261.    Languages Conference (HOPL-II), ACM SIGPLAN Notices, March 1993 (Vol
  262.    28, No 3).
  263.  
  264.    The name Icon is not an acronym, nor does it stand for anything in
  265.    particular, although the word iconoclastic was mentioned when the name
  266.    was chosen. The name predates the now common use of icon to refer to
  267.    small images used in graphical user interfaces. This sometimes
  268.    misleads people into thinking that that Icon is designed to create or
  269.    manipulate icons, but there's no good solution to that problem.
  270.  
  271.   C4. Where is Icon going?
  272.  
  273.    We continue to use Icon on a daily basis, but no significant changes
  274.    are planned. We expect to support the Unix version for the forseeable
  275.    future, and to distribute ports to other systems as supplied by
  276.    volunteers.
  277.  
  278.    The Unicon project is developing an object-oriented language based on
  279.    Icon. For more information, see unicon.sourceforge.net. An earlier
  280.    object-oriented extension to Icon, Idol, can be found in the Icon
  281.    program library.
  282.      _________________________________________________________________
  283.  
  284. Support
  285.  
  286.   D1. Is there a users' group for Icon?
  287.  
  288.    There is no official Icon users' group, but The Icon Project maintains
  289.    a moderated "Icon-group" electronic mailing list. To subscribe (or
  290.    unsubscribe), send a message to icon-group-request@cs.arizona.edu.
  291.  
  292.    There is a gateway between Icon-group and comp.lang.icon, an
  293.    unmoderated newsgroup for discussing issues related to Icon. The
  294.    gateway, which exchanges messages between the two systems, is
  295.    imperfect and not under the control of the Icon Project.
  296.  
  297.    The newsgroup generally provides faster response than the mailing list
  298.    and is less intrusive, but it sometimes suffers from inappropriate
  299.    postings. The Icon Project usually sends its announcements and other
  300.    messages to the mailing list.
  301.  
  302.   D2. How do I get technical support?
  303.  
  304.    The Icon Project is not a commercial organization, and its capacity
  305.    for providing technical support is limited. Please use the appropriate
  306.    resource when you need assistance:
  307.      * For programming assistance, submit a query to the mailing list or
  308.        newsgroup (see above).
  309.      * For porting assistance or Unix problems, contact
  310.        icon-project@cs.arizona.edu.
  311.      * For problems with the Windows implementation, contact the
  312.        implementor, jeffery@cs.nmsu.edu.
  313.      * For general information and additional documentation, visit the
  314.        Icon web site: www.cs.arizona.edu/icon.
  315.      _________________________________________________________________
  316.  
  317. Programming
  318.  
  319.   E1. Why doesn't read() work with every?
  320.  
  321.    every s := read() do {...} doesn't loop because read() produces a
  322.    single value and then fails if resumed. Other "consumer" procedures
  323.    such as get() and pop() work the same way. Use a while loop with these
  324.    procedures, and save every for use with generators such as !x or
  325.    key(T).
  326.  
  327.   E2. Why doesn't string invocation such as "foo"() work?
  328.  
  329.    String invocation works if the procedure is present; the catch is that
  330.    the linker removes unreferenced procedures. To ensure a procedure's
  331.    presence, reference it in the main() procedure. A simple reference
  332.    suffices, as in refs := [foo, bar, baz]; it's not necessary to
  333.    actually call it.
  334.  
  335.    (Why does the linker remove unreferenced procedures? Because this can
  336.    save huge amounts of memory for programs that use the library.)
  337.  
  338.   E3. How can I call a C function?
  339.  
  340.    You can't call an arbitrary C function, but if you're willing to write
  341.    a function to Icon's specifications, there are two approaches. Under
  342.    Unix, which provides loadfunc(), you can load one or more functions
  343.    from a shared library, and then treat them as if they had been written
  344.    in Icon. Some examples can be found in the cfuncs and packs/loadfuncs
  345.    directories of the Icon program library. The more cumbersome approach
  346.    is to add code to the Icon interpreter and rebuild it; some hooks are
  347.    provided for this purpose. Both approaches are discussed in Calling C
  348.    Functions from Icon, www.cs.arizona.edu/icon/docs/ipd240.htm.
  349.  
  350.    The Jcon implementation allows Icon programs to call Java code that is
  351.    written to Jcon specifications.
  352.  
  353.   E4. Can I open a bidirectional pipe?
  354.  
  355.    No, this is not possible. Although the concept is simple -- write a
  356.    line to a program via a pipe, then read that program's output -- it
  357.    probably wouldn't work. Most I/O libraries don't write anything to a
  358.    pipe until they've filled a buffer, and the most likely consequence
  359.    would be a deadlock, with each program waiting for the other to send
  360.    more data.
  361.      _________________________________________________________________
  362.  
  363.    This FAQ is edited by Gregg Townsend. It includes contributions from
  364.    Ralph Griswold, Cliff Hathaway, Clint Jeffery, Bob Alexander, and Todd
  365.    Proebsting.
  366.